Advertisement
Guest User

Untitled

a guest
Feb 9th, 2015
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.68 KB | None | 0 0
  1. <?
  2.  
  3. include './system/common.php';
  4.  
  5. include './system/functions.php';
  6.  
  7. include './system/user.php';
  8.  
  9. if(!$user) {
  10.  
  11. header('location: /');
  12.  
  13. exit;
  14.  
  15. }
  16.  
  17.  
  18. $title = 'Мятеж';
  19.  
  20. include './system/h.php';
  21.  
  22. if($user['level'] > 3) {
  23.  
  24.  
  25. $opponent_str = rand(10, 100);
  26. $opponent_vit = rand(10, 100);
  27. $opponent_agi = rand(10, 100);
  28. $opponent_def = rand(10, 100);
  29. $opponent_hp = $opponent_vit * 2;
  30.  
  31.  
  32. $member = mysql_query('SELECT * FROM `undying_member` WHERE `user` = "'.$user['id'].'" ORDER BY `id` DESC LIMIT 1');
  33. $member = mysql_fetch_array($member);
  34.  
  35. $battle = mysql_query('SELECT * FROM `undying` WHERE `id` = "'.$member['battle'].'"');
  36. $battle = mysql_fetch_array($battle);
  37.  
  38. if($member['exit'] == 0 && $battle['start'] == 1 && $battle['end'] == 0) {
  39.  
  40. $titans = mysql_result(mysql_query('SELECT COUNT(*) FROM `undying_member` WHERE `dead` = "0" AND `battle` = "'.$battle['id'].'"'),0);
  41.  
  42. if($titans == 0 OR $battle['opponents'] == 0) {
  43.  
  44. mysql_query('UPDATE `undying` SET `end` = "1" WHERE `id` = "'.$battle['id'].'"');
  45.  
  46. header('location: /undying/');
  47.  
  48. exit;
  49.  
  50. }
  51.  
  52. if($battle['time'] < time()) {
  53.  
  54. mysql_query('UPDATE `undying` SET `end` = "1" WHERE `id` = "'.$battle['id'].'"');
  55.  
  56. header('location: /undying/');
  57.  
  58. exit;
  59.  
  60. }
  61.  
  62. ?>
  63.  
  64. <div class='content'><font color='#ff9'><span style='float: right;'><?=_time($battle['time'] - time())?></span> Мятеж</font></div>
  65.  
  66. <?
  67.  
  68. if($member['dead'] == 0) {
  69.  
  70.  
  71. if($_GET['attack'] == true && $battle['opponents']) {
  72.  
  73. if($member['time'] > time() OR $user['mp'] < 50) {
  74.  
  75. header('location: /undying/');
  76.  
  77. exit;
  78.  
  79. }
  80.  
  81. if($user['ability_1'] > 0) {
  82. switch($user['ability_1']) {
  83. case 0:
  84. $a_1_bonus = 25;
  85. $a_1_chanse = 5;
  86. break;
  87. case 1:
  88. $a_1_bonus = 25;
  89. $a_1_chanse = 5;
  90. break;
  91. case 2:
  92. $a_1_bonus = 30;
  93. $a_1_chanse = 5;
  94. break;
  95. case 3:
  96. $a_1_bonus = 35;
  97. $a_1_chanse = 5;
  98. break;
  99. case 4:
  100. $a_1_bonus = 40;
  101. $a_1_chanse = 5;
  102. break;
  103. case 5:
  104. $a_1_bonus = 45;
  105. $a_1_chanse = 5;
  106. break;
  107. case 6:
  108. $a_1_bonus = 45;
  109. $a_1_chanse = 8;
  110. break;
  111. case 7:
  112. $a_1_bonus = 50;
  113. $a_1_chanse = 8;
  114. break;
  115. case 8:
  116. $a_1_bonus = 55;
  117. $a_1_chanse = 8;
  118. break;
  119. case 9:
  120. $a_1_bonus = 60;
  121. $a_1_chanse = 8;
  122. break;
  123. case 10:
  124. $a_1_bonus = 65;
  125. $a_1_chanse = 8;
  126. break;
  127. case 11:
  128. $a_1_bonus = 65;
  129. $a_1_chanse = 11;
  130. break;
  131. case 12:
  132. $a_1_bonus = 70;
  133. $a_1_chanse = 11;
  134. break;
  135. case 13:
  136. $a_1_bonus = 75;
  137. $a_1_chanse = 11;
  138. break;
  139. case 14:
  140. $a_1_bonus = 80;
  141. $a_1_chanse = 11;
  142. break;
  143. case 15:
  144. $a_1_bonus = 85;
  145. $a_1_chanse = 11;
  146. break;
  147. case 16:
  148. $a_1_bonus = 85;
  149. $a_1_chanse = 14;
  150. break;
  151. case 17:
  152. $a_1_bonus = 90;
  153. $a_1_chanse = 14;
  154. break;
  155. case 18:
  156. $a_1_bonus = 95;
  157. $a_1_chanse = 14;
  158. break;
  159. case 19:
  160. $a_1_bonus = 100;
  161. $a_1_chanse = 14;
  162. break;
  163. case 20:
  164. $a_1_bonus = 105;
  165. $a_1_chanse = 14;
  166. break;
  167. case 21:
  168. $a_1_bonus = 105;
  169. $a_1_chanse = 17;
  170. break;
  171. case 22:
  172. $a_1_bonus = 145;
  173. $a_1_chanse = 20;
  174. break;
  175. case 23:
  176. $a_1_bonus = 165;
  177. $a_1_chanse = 23;
  178. break;
  179. case 24:
  180. $a_1_bonus = 165;
  181. $a_1_chanse = 23;
  182. break;
  183. }
  184.  
  185. if(mt_rand(0, 100) <= $a_1_chanse) {
  186.  
  187. $a_1 = true;
  188.  
  189. }
  190.  
  191. }
  192.  
  193.  
  194. if($user['ability_2'] > 0) {
  195. switch($user['ability_2']) {
  196. case 0:
  197. $a_2_bonus = 25;
  198. $a_2_chanse = 5;
  199. break;
  200. case 1:
  201. $a_2_bonus = 25;
  202. $a_2_chanse = 5;
  203. break;
  204. case 2:
  205. $a_2_bonus = 30;
  206. $a_2_chanse = 5;
  207. break;
  208. case 3:
  209. $a_2_bonus = 35;
  210. $a_2_chanse = 5;
  211. break;
  212. case 4:
  213. $a_2_bonus = 40;
  214. $a_2_chanse = 5;
  215. break;
  216. case 5:
  217. $a_2_bonus = 45;
  218. $a_2_chanse = 5;
  219. break;
  220. case 6:
  221. $a_2_bonus = 45;
  222. $a_2_chanse = 8;
  223. break;
  224. case 7:
  225. $a_2_bonus = 50;
  226. $a_2_chanse = 8;
  227. break;
  228. case 8:
  229. $a_2_bonus = 55;
  230. $a_2_chanse = 8;
  231. break;
  232. case 9:
  233. $a_2_bonus = 60;
  234. $a_2_chanse = 8;
  235. break;
  236. case 10:
  237. $a_2_bonus = 65;
  238. $a_2_chanse = 8;
  239. break;
  240. case 11:
  241. $a_2_bonus = 65;
  242. $a_2_chanse = 11;
  243. break;
  244. case 12:
  245. $a_2_bonus = 70;
  246. $a_2_chanse = 11;
  247. break;
  248. case 13:
  249. $a_2_bonus = 75;
  250. $a_2_chanse = 11;
  251. break;
  252. case 14:
  253. $a_2_bonus = 80;
  254. $a_2_chanse = 11;
  255. break;
  256. case 15:
  257. $a_2_bonus = 85;
  258. $a_2_chanse = 11;
  259. break;
  260. case 16:
  261. $a_2_bonus = 85;
  262. $a_2_chanse = 14;
  263. break;
  264. case 17:
  265. $a_2_bonus = 90;
  266. $a_2_chanse = 14;
  267. break;
  268. case 18:
  269. $a_2_bonus = 95;
  270. $a_2_chanse = 14;
  271. break;
  272. case 19:
  273. $a_2_bonus = 100;
  274. $a_2_chanse = 14;
  275. break;
  276. case 20:
  277. $a_2_bonus = 105;
  278. $a_2_chanse = 14;
  279. break;
  280. case 21:
  281. $a_2_bonus = 105;
  282. $a_2_chanse = 17;
  283. break;
  284. case 22:
  285. $a_2_bonus = 145;
  286. $a_2_chanse = 20;
  287. break;
  288. case 23:
  289. $a_2_bonus = 165;
  290. $a_2_chanse = 23;
  291. break;
  292. case 24:
  293. $a_2_bonus = 165;
  294. $a_2_chanse = 23;
  295. break;
  296. }
  297.  
  298. if(mt_rand(0, 100) <= $a_2_chanse) {
  299.  
  300. $a_2 = true;
  301.  
  302. }
  303. }
  304.  
  305. if($user['ability_3'] > 0) {
  306.  
  307. switch($user['ability_3']) {
  308. case 0:
  309. $a_3_bonus = 5;
  310. $a_3_crit_chanse = 5;
  311. $a_3_chanse = 20;
  312. break;
  313. case 1:
  314. $a_3_bonus = 5;
  315. $a_3_crit_chanse = 5;
  316. $a_3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement